<template>
  <div id="app">
    <button @click="showFn">弹窗</button>
    <my-popup
      :show.sync="show"
      @updata:show="show = $event"
      :title="title"
      :defaultChecked="defaultChecked"
      v-model="input"
      :data="data"
      :defaultProps="defaultProps"
    >
    </my-popup>
    <!-- <my-tree :data="data" :defaultProps="defaultProps"></my-tree> -->
  </div>
</template>

<script>
import myPopup from "./components/my-popup";
// import MyTree from "./components/my-tree.vue";
export default {
  name: "App",
  components: {
    myPopup,
    // MyTree,
  },
  data() {
    return {
      input: "",
      show: false,
      title: "选择产品",
      defaultChecked: [5, 7, 8],
      data: [
        {
          id: 1,
          label: "产品系列1",
          children: [
            {
              id: 5,
              label: "学习",
              children: [
                {
                  id: 6,
                  label: "看书",
                },
                {
                  id: 7,
                  label: "看电影",
                },
              ],
            },
          ],
        },
        {
          id: 2,
          label: "产品系列2",
          children: [
            {
              id: 8,
              label: "游戏",
              children: [
                {
                  id: 9,
                  label: "dota",
                },
                {
                  id: 3,
                  label: "lol",
                },
              ],
            },
          ],
        },
        {
          id: 4,
          label: "产品系列3",
          children: [
            {
              id: 11,
              label: "音乐",
              children: [
                {
                  id: 12,
                  label: "流行",
                },
                {
                  id: 13,
                  label: "摇滚",
                },
              ],
            },
          ],
        },
      ],
      defaultProps: {
        children: "children",
        label: "label",
      },
    };
  },
  methods: {
    showFn() {
      this.show = true;
    },
  },
};
</script>

<style></style>
